// 合同
import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询合同列表
export function findContract(query) {
  return request({
    url: '/credit/contract/findAll',
    method: 'get',
    params: query
  })
}

  //模糊合同查询
export function searchContract(query){
    return request({
      url: '/credit/contract/searchContract',
      method: 'get',
      params:query
    })
    } 

   // 查询用户列表
export function listContract(query) {
  return request({
    url: '/credit/contract/list',
    method: 'get',
    params: query
  })
}


// 查询用户详细信息
export function getContract(orderId) {
    return request({
      url: '/credit/contract/userDetail/' + parseStrEmpty(orderId),
      method: 'get'
    })
  }

//   // 用户状态修改
// export function changeContractStatus(userId, contractStatus) {
//   const data = {
//     userId,
//     contractStatus
//   }
//   return request({
//     url: '/credit/contract/changeStatus',
//     method: 'put',
//     data: data
//   })
// }

// 修改合同状态
export function changeContractStatus(data) {
  return request({
    url: '/credit/contract/changeStatus',
    method: 'put',
    data: data
  })
} 